﻿using ThingsEdge.Contracts;
using ThingsEdge.Router.Forwarders;

namespace Digitalmes.Infrastructure.Scada.Forwarders;

/// <summary>
/// 请求消息（触发）处理。
/// </summary>
internal sealed class NativeRequestForwarderHandler(ILogger<NativeRequestForwarderHandler> logger) : IRequestForwarderHandler
{
    public async Task<ResponseMessage> HandleAsync(RequestMessage message, CancellationToken cancellationToken = default)
    {
        await Task.CompletedTask;

        logger.LogInformation("请求消息处理，数据：{@Value}", message.Values.Select(s => new { s.Address, s.Value }));

        return new ResponseMessage()
        {
            Request = message,
        };
    }
}
